package cn.bonoon.controllers.faq;

import cn.bonoon.entities.interacting.FaqCatalogEntity;
import cn.bonoon.kernel.annotations.Transform;
import cn.bonoon.kernel.support.models.ObjectEditor;
import cn.bonoon.kernel.web.annotations.AutoDataLoader;
import cn.bonoon.kernel.web.annotations.components.AsComboBox;
import cn.bonoon.kernel.web.annotations.components.AsEditor;
import cn.bonoon.kernel.web.annotations.components.AsSelector;
import cn.bonoon.kernel.web.annotations.components.AsTextArea;
import cn.bonoon.kernel.web.annotations.form.FormEditor;
import cn.bonoon.kernel.web.annotations.form.PropertyEditor;

@Transform
@FormEditor(value = 2, width = 250)
public class FaqEditor extends ObjectEditor implements FaqDefine {

	private static final long serialVersionUID = -3778640802569622127L;

	@PropertyEditor(value = 0, required = true, colspan = 1)
	@AsComboBox
	@AutoDataLoader(FaqCatalogEntity.class)
	private Long catalog;

	@PropertyEditor(value = 10, required = true)
	private int ordinal;
	@PropertyEditor(value = 11)
	@AsSelector(title = "")
	private int level;

	@PropertyEditor(value = 20, colspan = 1)
	@AsTextArea(rows = 6)
	private String question;

	@PropertyEditor(value = 21, colspan = 1)
	@AsEditor
	private String answer;

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public int getOrdinal() {
		return ordinal;
	}

	public void setOrdinal(int ordinal) {
		this.ordinal = ordinal;
	}

	public Long getCatalog() {
		return catalog;
	}

	public void setCatalog(Long catalog) {
		this.catalog = catalog;
	}

}
